package listener;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;

@WebListener
public class SessionListener implements HttpSessionListener{

    @Override
    public void sessionCreated(HttpSessionEvent se) {
        //request.getSession()
        System.out.println("创建session");
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        //session 存在的时间达到了定义的超时时间(默认30分钟)
        //手动销毁session session.invalitate()
        System.out.println("销毁session");
    }

}
